<template>
	<view class="container">
		<!-- <u-navbar 
			:title="title" 
			:customBack="onClickBack" 
		></u-navbar> -->
		<com-head textTit="支付" :typeVal="1" :scrollTop="scrollTop" :backType="1"></com-head>
		
		
		
		<view class="content">
			<image src="//jiudao123.oss-cn-shanghai.aliyuncs.com/store/img/chenggong.png" mode=""></image>
			<view class="tag" v-if="type == 1">恭喜您提交成功</view>
			<view class="tag" v-if="type == 2">恭喜您已提交</view>
			<view class="txt" v-if="type == 2">请耐心等待，可进入发票历史查看详情</view>
			<view class="tag" v-if="type == 3">恭喜您发布成功 </view>
			<view class="tag" v-if="type == 4||type == 6">恭喜您已支付成功 </view>
			<view class="tag" v-if="type == 5" >恭喜您预约成功 </view>
			<view class="txt" v-if="type == 5" >预约为您保留至开场后10分钟！ </view>
		</view>
		<view class="sure" v-if="type == 1 || type == 3 || type == 5" @click="goUrl()">确定</view>
		<view class="sure" v-if="type == 2" @click="utlis.goUrl(`/pages/mine/invoiceHistoryList?type=1`)">进入开票历史</view>
		<view class="paySuccess" v-if="type == 4 || type == 6">
			<view class="common" @click="goShop()">返回</view>
			<view class="common bg" @click="look()" v-if="type == 6 && !negotiation">{{types == 1 ? '查看详情' : '查看核验码'}}</view>
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				title:'',
				type:1,
				order_id:'',
				types:'',
				scrollTop: 0,
				negotiation: false, // 代付进来的
				is_singles: 0
			}
		},
		onPageScroll(e){
			this.scrollTop = e.scrollTop
		},
		async onLoad(option) {
			if(option.types){
				this.types = option.types
			}
			if(option.order_id){
				this.order_id = option.order_id
			}
			if (option.negotiation){
				this.negotiation = true
			}
			if (option.is_single) {
				this.is_singles = option.is_single
			}
			if(option.type){
				this.type = option.type
				if(this.type == 5){
					this.title = "预约成功"
					// uni.setNavigationBarTitle({ title: '' })  
				}else if(this.type == 4 || this.type == 6){
					this.title = "支付"
					// uni.setNavigationBarTitle({ title: '' })  
				}else if(this.type == 3){
					this.title = "评价"
					// uni.setNavigationBarTitle({ title: '评价' })  
				}else if(this.type == 1){
					this.title = "投诉与建议"
					// uni.setNavigationBarTitle({ title: '' })  
				}else{
					this.title = "发票申请"
				}
			}
		},
		methods: {
			onClickBack(){
				if(this.type == 3 ){
					this.utlis.backPage(2)
				}else if(this.type == 1){
					this.utlis.backPage(1)
				}else if(this.type == 2){
					this.utlis.backPage(3)
				}else{
					uni.switchTab({
						url:"/pages/index/index"
					})
				}
				
			},
			goShop(){
				// uni.switchTab({
				// 	url:'../shop/index'
				// })
				uni.switchTab({
					url:"/pages/index/index"
				})
			},
			// 查看二维码
			look(){
				if (this.types != 1) {
					uni.navigateTo({
						url:`/pages/mine/submitSuccessT?id=${this.order_id}&is_single=${this.is_singles}`
					})
				} else {
					uni.navigateTo({
						url:`/pages/mine/submitSuccessT?id=${this.order_id}&is_single=${this.is_singles}`
					})
				}
				
			},
			goUrl(){
				if(this.type == 5){
					// 去预约订单列表页面
					// this.utlis.backPage(2);
					uni.navigateTo({
						url:"/pages/myReserva/index"
					})
				}else if(this.type == 6){
					uni.navigateTo({
						url:`/pages/order/orderList?status=10`
					})
				}else if(this.type == 3){
					this.utlis.backPage(2)
					console.log(this.type,"this.type")
				}else if(this.type == 1){
					this.utlis.backPage(1)
				}else if(this.type == 2){
					this.utlis.backPage(1)
				}
			}
		}
	}
</script>

<style lang="scss" scoped >
.container{
	padding: 50rpx 32rpx;
	.paySuccess{
		display: flex;
		justify-content: space-between;
		align-items: center;
		position: fixed;
		bottom: 116rpx;
		left: 50%;
		transform: translate(-50%);
		.common{
			width: 320rpx;
			line-height: 100rpx;
			border: 1px solid #007664;
			border-radius: 14rpx;
			text-align: center;
			color: #007664;
			font-size: 32rpx;
		}
		.bg{
			border: none;
			background: linear-gradient(140deg, #50DCC2 0%, #007664);
			color: #FFFFFF;
			margin-left: 30rpx;
		}
	}
	.content{
		width: 600rpx;
		position: fixed;
		top: 234rpx;
		left: 50%;
		transform: translateX(-50%);
		text-align: center;
		image{
			width: 362rpx;
			height: 307rpx;
			margin-bottom: 31rpx;
			margin-top: 200rpx;
		}
		.tag{
			font-size: 40rpx;
			color: #242833;
			margin-bottom: 44rpx;
		}
		.txt{
			color: #666666;
			font-size: 26rpx;
		}
	}
	.sure{
		width: 670rpx;
		line-height: 100rpx;
		background: linear-gradient(140deg, #50DCC2 0%, #007664);
		border-radius: 48rpx;
		text-align: center;
		position: fixed;
		bottom: 116rpx;
		left: 50%;
		transform: translateX(-50%);
		color: #FFFFFF;
		font-size: 32rpx;
	}
}
.u-icon{
	color: #000 !important;
}
</style>
